package main

import "fmt"

/*

 */
type Student4 struct {
	Name string
	Age  int
}

//定义方法：
func (s Student4) test01() {
	fmt.Println(s.Name)
}

func main() {
	//方式1: 按照顺序进行赋值
	var s1 Student4 = Student4{"张三", 19}
	fmt.Println(s1)

	fmt.Println("---------------- ---------------- ----------------")

	//方式2: 按照指定类型
	var s2 Student4 = Student4{
		Name: "李四",
		Age:  20,
	}
	fmt.Println(s2)

	fmt.Println("---------------- ---------------- ----------------")

	var s3 *Student4 = &Student4{"明明", 26}
	fmt.Println(s3)

	fmt.Println("---------------- ---------------- ----------------")

	var s4 *Student4 = &Student4{
		Name: "娜娜",
		Age:  26,
	}
	fmt.Println(s4)

}
